package com.bw.day_2.fg

import android.os.Bundle
import androidx.fragment.app.Fragment
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import com.bw.base.mvvm.BaseFragement
import com.bw.base.mvvm.BaseViewFragement
import com.bw.day_2.R
import com.bw.day_2.adapter.GaoAdapter
import com.bw.day_2.databinding.FragmentBlank1Binding
import com.bw.day_2.fgviewmodel.GonggaoViewModel
import dagger.hilt.android.AndroidEntryPoint

@AndroidEntryPoint
class BlankFragment1 : BaseFragement<FragmentBlank1Binding,GonggaoViewModel>() {
    var gaoAdapter = GaoAdapter()
    override fun initView() {
        viewModel.announcements(1,10)
        binding.rv2.adapter = gaoAdapter

    }

    override fun initData() {
        viewModel.gonggaoSuccess.observe(this){
            gaoAdapter.data.clear()
            gaoAdapter.data.addAll(it)
            gaoAdapter.notifyDataSetChanged()
        }
    }

}